<template>
  <div>
    <input type="text" v-model="name">
  </div>
</template>

<script>
export default {
  data () {
    return {
      name:''
    }
  },
  // watch 侦听器结构 - 侦听 data 或 computed 值的变化
  watch: {
    name(newVal, oldVal){
      console.log(newVal, oldVal);
    }
  }
}
</script>

<style>

</style>